<template>
    <div class="hello">
        <span>我的全局组件</span>
        <h1>{{ msg.title }}</h1>
        <h1>{{ msg.year }}</h1>
    </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, PropType, provide, inject  } from 'vue';

export default defineComponent({
    props: {
        msg: {
            type: Object as PropType<Message>
        }
    },
    
    setup(props: any) {
        const foo = inject('geolocation')
        onMounted(() => {
            if (foo) {
                console.log(foo)
            }
        })
        return {
            
        }
    }
}) 
    

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
